<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>企业拜访记录列表</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <!--link导入外部的css，js样式，如果导入的资源和本页面在同一个文件夹下，直接文件名即可-->
    <link rel="stylesheet" th:href="@{/asserts/bower_components/bootstrap/dist/css/bootstrap.min.css}">
    <!-- jQuery 3 -->
    <script th:src="@{/asserts/bower_components/jquery/dist/jquery.min.js}"></script>
    <!-- Bootstrap 3.3.7 -->
    <script th:src="@{/asserts/bower_components/bootstrap/dist/js/bootstrap.min.js}"></script>
    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{/asserts/bower_components/font-awesome/css/font-awesome.min.css}">
    <!-- Ionicons -->
    <link rel="stylesheet" th:href="@{/asserts/bower_components/Ionicons/css/ionicons.min.css}">
    <!-- DataTables -->
    <link rel="stylesheet" th:href="@{/asserts/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/asserts/dist/css/AdminLTE.min.css}">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" th:href="@{/asserts/dist/css/skins/_all-skins.min.css}">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->

    <link rel="stylesheet" th:href="@{/asserts/Apolar_sh/lib/css/bigautocomplete.css}" type="text/css"/>
    <script th:src="@{/asserts/Apolar_sh/lib/js/allhrc.js}"></script>
    <script th:src="@{/asserts/Apolar_sh/lib/js/companyName.js}"></script>

    <script th:src="@{/asserts/Apolar_sh/lib/layer/2.4/layer.js}"></script>

    <script th:src="@{/asserts/Apolar_sh/lib/js/fileinput.min.js}"></script>
    <script th:src="@{/asserts/Apolar_sh/lib/js/fileinput_locale_zh.js}"></script>
    <link th:href="@{/asserts/Apolar_sh/lib/css/fileinput.min.css}" media="all" rel="stylesheet" type="text/css"/>

    <!-- Google Font -->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
    <style type="text/css">
        .search {
            margin-top: 40px;
            margin-left: 40px;
            position: relative;
        }

        #example1 td {
            text-align: center;
        }

        th {
            text-align: center;
        }

        #top {
            background-color: rgba(172, 175, 175, 0.78);
            display: none;
            position: fixed;
            right: -3px;
            bottom: 50px;
        }

        #top a {
            color: rgba(61, 61, 61, 0.91);
            font-size: 45px;
        }

        #home {
            display: block;
            position: absolute;
            right: 10px;
            top: 8px;
            z-index: 9999;
            font-size: 30px;
        }

        #refresh {
            display: block;
            position: absolute;
            right: 46px;
            top: 10px;
            z-index: 9999;
            font-size: 26px;
        }

    </style>

</head>
<body>

<a name="up"></a>
<span>
    <a id="refresh" class="fa fa-refresh"  href="javascript:location.reload()"></a>
    <a id="home" class="fa fa-home" th:href="@{/comVisit/visitList(pageNow=${pageNow},coId=${coId})}"></a>
</span>
<div class="wrapper">
    <!-- Content Wrapper. Contains page content -->
    <!-- Content Header (Page header) -->
    <!-- Main content -->
    <section class="content-header">
        <h4 th:if="${pageNow==null || pageNow.equals('')}">
            <i class="fa fa-search"></i> 搜索企业拜访记录
        </h4>
    </section>

    <div class="search" style="margin-top: 15px">

        <div class="row">
            <div class="col-xs-9">
                <span style="font-size: 26px;font-weight: bold" th:if="${pageNow!=null && !pageNow.equals('') && info==null}" th:text="${'拜访记录——'+pageBean.list.get(0).coName}">
                </span>
                <form class="form-inline" method="post" id="searchFrom" th:if="${pageNow==null || pageNow eq ''}"
                      th:action="@{/comVisit/visitSearch(pageSize=${pageBean==null?5:pageBean.pageSize},currentPage=1)}">

                    <div class="form-group">
                        <label for="personname"> 发起人员：</label>
                        <input type="text" class="form-control" name="personname" id="personname" th:if="${session.user.authority != 3}"
                               th:value="${personname}" placeholder="请输入发起人员">
                        <input type="text" class="form-control" name="personname" id="personname" th:if="${session.user.authority == 3}"
                               th:value="${session.user.personname}" readonly placeholder="请输入发起人员">
                    </div>
                    <div class="form-group">
                        <label for="coName"> 企业名称：</label>
                        <input type="text" class="form-control" name="coName"  id="coName"
                               th:value="${coName}" placeholder="请输入企业名称">
                    </div>
                    <div class="form-group">
                        <label for="comVisitDate">拜访日期：</label>
                        <input type="date" class="form-control" name="comVisitDate" id="comVisitDate" th:value="${comVisitDate}">
                    </div>
                    <button type="submit" class="btn btn-success"><i class="fa fa-search"></i> 搜索</button>
                </form>

            </div>
            <div class="col-xs-3">

                <a class="btn btn-info" th:if="${info==null}"
                   th:href="@{/comVisit/visitAddUI(pageSize=${pageBean.pageSize},currentPage=${pageBean.pageNum},searchUrl=${searchUrl},pageNow=${pageNow},coId=${coId})}">
                    <i class="fa fa-plus"></i> 添加拜访记录
                </a>
                <a class="btn btn-info" th:if="${info!=null}"
                   th:href="@{/comVisit/visitAddUI(pageSize=${5},currentPage=${1},searchUrl=${searchUrl},pageNow=${pageNow},coId=${coId})}">
                    添加拜访记录
                </a>
                <a class="btn btn-info " th:if="${pageNow!=null && !pageNow.equals('')}" th:href="@{/company/findAll(currentPage=${pageNow})}">
                    <i class="fa fa-backward"></i> 返回
                </a>
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </div>

    <!-- /.content -->
</div>

<div class="wrapper">
    <!-- Content Wrapper. Contains page content -->
    <!-- Content Header (Page header) -->
    <section class="content-header" style="padding-bottom: 0px;padding-top: 5px">
        <h4>
            <div class="form-group" style="padding-bottom: 0px;margin-bottom: 0px">
                <i th:if="${searchUrl==null}" class="fa fa-navicon col-sm-2 control-label" style="margin-top: 4px">拜访记录列表</i>
                <i th:if="${searchUrl!=null}" class="fa fa-navicon col-sm-2 control-label" style="margin-top: 4px">搜索结果列表</i>
                <span th:if="${info==null||pageBean!=null}" style="margin-bottom: 0px">每页显示：</span>
                <span class="control-label">
                    <select th:if="${info==null||pageBean!=null}" class="" name="pageSize" id="pageSize"
                            th:onchange="changePage([[${searchUrl}]],[[${coId}]],[[${pageNow}]])">
                        <option th:selected="${pageBean.pageSize==5}" value="5">&nbsp;5</option>
                        <option th:selected="${pageBean.pageSize==10}" value="10">10</option>
                        <option th:selected="${pageBean.pageSize==20}" value="20">20</option>
                    </select>
                </span>
            </div>
        </h4>

    </section>

    <!-- Main content -->
    <section class="content" style="padding-bottom: 0px;padding-top: 0px">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <!-- /.box-header 部门列表的显示  table  表格  th/td单元个   th字体加粗，行标题-->
                    <div th:if="${info==null}" class="box-body">
                        <form th:action="@{/comVisit/visitDelete(pageSize=${pageBean.pageSize},currentPage=${pageBean.pageNum},searchUrl=${searchUrl},pageNow=${pageNow},coId=${coId})}"
                              id="myForm" method="post">
                            <table id="example1" class="table table-bordered table-striped">

                                <thead>
                                <tr>
                                    <th th:if="${session.user.authority != 3}">选择</th>
                                    <th>企业名称</th>
                                    <th>拜访日期</th>
                                    <th>拜访事件</th>
                                    <th>拜访人</th>
                                    <th>发起人</th>
                                    <th>洽谈方式</th>
                                    <th>洽谈内容/备注</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr th:each="comVi:${pageBean.list}">
                                    <td th:if="${session.user.authority != 3}">
                                        <input type="checkbox" name="checks" id="checks" class="checks" onchange="recordId(this)"
                                               th:value="${comVi.comVisitId}"/>
                                    </td>
                                    <td th:text="${comVi.coName}"></td>
                                    <td th:text="${#dates.format(comVi.comVisitDate, 'yyyy-MM-dd')}"></td>
                                    <td th:text="${comVi.comVisitPurpose}"></td>
                                    <td th:text="${comVi.comVisitVisitor}"></td>
                                    <td th:text="${comVi.personname}"></td>
                                    <td th:text="${comVi.comVisitType}"></td>
                                    <td>
                                        <a class="btn btn-info" data-toggle="modal"
                                           th:data-target="${'#myInfo'+comVi.comVisitId}">
                                            <i class="fa fa-info"></i> 洽谈详情/备注
                                        </a>
                                        <!-- Modal -->
                                        <div class="modal fade " th:id="${'myInfo'+comVi.comVisitId}" tabindex="-1"
                                             role="dialog" aria-labelledby="myModalLabel">
                                            <div class="modal-dialog " role="document">
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                        <button type="button" class="close" data-dismiss="modal"
                                                                aria-label="Close"><span
                                                                aria-hidden="true">&times;</span>
                                                        </button>
                                                        <h4 class="modal-title" id="myModalLabel"><i
                                                                class="fa fa-info"></i> 洽谈详情/备注</h4>
                                                    </div>
                                                    <div class="modal-body">
                                                        <table class="table table-striped table-bordered">
                                                            <tbody>
                                                            <tr>
                                                                <td style="width: 100px;"><strong>洽谈内容：</strong></td>
                                                                <td th:text="${comVi.comVisitDetails}"></td>

                                                            </tr>
                                                            <tr>
                                                                <td style="width: 100px"><strong>备 &nbsp;&nbsp; &nbsp;注
                                                                    ：</strong></td>
                                                                <td th:text="${comVi.comVisitRemarks}"></td>
                                                            </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <a class="btn btn-warning"
                                           th:href="@{/comVisit/visitModifyUI(comVisitId=${comVi.comVisitId},pageSize=${pageBean.pageSize},currentPage=${pageBean.pageNum},searchUrl=${searchUrl},pageNow=${pageNow},coId=${coId})}">
                                            <i class="fa fa-edit"></i> 修改
                                        </a>
                                        <a class="btn btn-danger" th:onclick="submitDelete([[${comVi.comVisitId}]])" th:if="${session.user.authority != 3}">
                                            <i class="fa fa-trash"></i> 删除
                                        </a>
                                    </td>
                                </tr>
                                </tbody>
                                <tfoot>
                                <tr>
                                    <td th:if="${session.user.authority != 3}">
                                        <label><input type="checkbox" id="all" onchange="checkAllId(this)"/>&nbsp;&nbsp;全选</label>
                                    </td>
                                    <td colspan="8" style="text-align:left;padding-left:20px;">
                                        <a class="btn btn-danger" th:onclick="submit()" th:if="${session.user.authority != 3}">
                                            <i class="fa fa-trash"></i> 批量删除
                                        </a>
                                        <a class="btn btn-primary" style="padding: 5px 15px;" th:href="@{/comVisit/exportTemplate}">
                                            <i class="fa fa-download"></i> 导出当前页EXCEL模板
                                        </a>
                                        <a th:if="${session.user.department == 'hrc' && session.user.authority == 1}" class="btn btn-primary" style="padding: 5px 15px;" th:href="@{/comVisit/export}">
                                            <i class="fa fa-download"></i> 导出到EXCEL
                                        </a>

                                        <a class="btn btn-primary" data-toggle="modal" data-target="#mydialog1">
                                            <i class="fa fa-upload"></i> 导入EXCEL
                                        </a>

                                    </td>
                                </tr>
                                </tfoot>
                            </table>
                        </form>


                        <!-- 分页 -->
                        <nav aria-label="Page navigation">
                            <ul class="pagination">

                                <li>
                                    <a th:if="${pageBean.pageNum!=1 && searchUrl==null }"
                                       th:href="@{/comVisit/visitList(currentPage=1,pageSize=${pageBean.pageSize},pageNow=${pageNow},coId=${coId})}">首页</a>
                                    <a th:if="${pageBean.pageNum==1}"
                                       href="javascript:void(0)">首页</a>
                                    <a th:if="${pageBean.pageNum!=1 && searchUrl!=null }"
                                       th:href="@{${searchUrl}(currentPage=1,pageSize=${pageBean.pageSize})}">首页</a>
                                </li>

                                <li th:if="${pageBean.pageNum!=1 && searchUrl==null }">
                                    <a th:href="@{/comVisit/visitList(currentPage=${pageBean.pageNum-1},pageSize=${pageBean.pageSize},pageNow=${pageNow},coId=${coId})}"
                                       aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                </li>
                                <li class="disabled" th:if="${pageBean.pageNum==1 }">
                                    <a href="javascript:void(0)" aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                </li>
                                <li th:if="${pageBean.pageNum!=1 && searchUrl!=null }">
                                    <a th:href="@{${searchUrl}(currentPage=${pageBean.pageNum-1},pageSize=${pageBean.pageSize})}"
                                       aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                </li>

                                <li th:classappend="${pageBean.pageNum==pageIndex}?'active':''"
                                    th:each="pageIndex:${pageValue}">
                                    <a href="javascipt:void(0)"
                                       th:if="${pageBean.pageNum==pageIndex}"
                                       th:text="${pageIndex}"></a>
                                    <a th:if="${pageIndex==-1}" style="cursor: default;opacity: 0.6;">
                                        ...
                                    </a>
                                    <a th:if="${pageBean.pageNum!=pageIndex&&pageIndex!=-1 && searchUrl==null}"
                                       th:href="@{/comVisit/visitList(currentPage=${pageIndex},pageSize=${pageBean.pageSize},pageNow=${pageNow},coId=${coId})}"
                                       th:text="${pageIndex}"></a>
                                    <a th:if="${pageBean.pageNum!=pageIndex&&pageIndex!=-1 && searchUrl!=null}"
                                       th:href="@{${searchUrl}(currentPage=${pageIndex},pageSize=${pageBean.pageSize})}"
                                       th:text="${pageIndex}"></a>
                                </li>

                                <li class="disabled" th:if="${pageBean.pageNum==pageBean.pages }">
                                    <a href="javascript:void(0)" aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>
                                <li th:if="${pageBean.pageNum!=pageBean.pages &&searchUrl==null }">
                                    <a th:href="@{/comVisit/visitList(currentPage=${pageBean.pageNum+1},pageSize=${pageBean.pageSize},pageNow=${pageNow},coId=${coId})}"
                                       aria-label="Next"> <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>
                                <li th:if="${pageBean.pageNum!=pageBean.pages &&searchUrl!=null }">
                                    <a th:href="@{${searchUrl}(currentPage=${pageBean.pageNum+1},pageSize=${pageBean.pageSize})}"
                                       aria-label="Next"> <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>

                                <li>
                                    <a th:if="${pageBean.pageNum!=pageBean.pages &&searchUrl==null  }"
                                       th:href="@{/comVisit/visitList(currentPage=${pageBean.pages},pageSize=${pageBean.pageSize},pageNow=${pageNow},coId=${coId})}">末页</a>
                                    <a th:if="${pageBean.pageNum==pageBean.pages }"
                                       href="javascript:void(0)">末页</a>
                                    <a th:if="${pageBean.pageNum!=pageBean.pages &&searchUrl!=null  }"
                                       th:href="@{${searchUrl}(currentPage=${pageBean.pages},pageSize=${pageBean.pageSize})}">末页</a>
                                </li>


                            </ul>
                        </nav>
                    </div>
                    <div th:if="${info!=null}" class="box-body">
                        <h2 style="text-align:center;color: #ff0000;font-size: 30px;font-weight: bold" th:text="${info}"></h2>
                        <a class="btn btn-primary" style="padding: 5px 15px;" th:href="@{/comVisit/exportTemplate}">
                            <i class="fa fa-download"></i> 导出当前页EXCEL模板
                        </a>
                        <a th:if="${session.user.department == 'hrc' && session.user.authority == 1}" class="btn btn-primary" style="padding: 5px 15px;" th:href="@{/comVisit/export}">
                            <i class="fa fa-download"></i> 导出到EXCEL
                        </a>

                        <a class="btn btn-primary" data-toggle="modal" data-target="#mydialog1">
                            <i class="fa fa-upload"></i> 导入EXCEL
                        </a>

                    </div>
                    <!-- Excel Modal -->
                    <div class="modal fade" id="mydialog1"
                         tabindex="-1" role="dialog"
                         aria-labelledby="myModalLabel">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h4 class="modal-title" style="text-align: center;">
                                        <i class="fa fa-upload"></i>&nbsp;&nbsp;导入EXCEL
                                    </h4>
                                </div>
                                <div class="modal-body">
                                    <form style="text-align:left;" enctype="multipart/form-data" id="uploadFile"
                                          method="post" th:action="@{/comVisit/import}">
                                        <div class="form-group">
                                            <label>EXCEL：</label>
                                            <input id="input-b2" name="file" size="100" type="file" class="file"
                                                   data-show-preview="true" data-show-upload="false"
                                                   data-show-cancel="false"
                                                   accept="application/vnd.ms-excel"
                                                   placeholder="请选择一个Excel文件">
                                        </div>
                                        <div class="modal-footer">
                                            <button type="button" class="btn btn-default"
                                                    data-dismiss="modal">
                                                <i class="fa fa-close"></i> 取消
                                            </button>
                                            <button type="submit" class="btn btn-success">
                                                <i class="fa fa-upload"></i> 上传
                                            </button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- Excel Modal -->

                    <div id="top">
                        <a href="#up" title="回到顶部" class="fa fa-angle-double-up"></a>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </section>
    <!-- /.content -->
</div>

<!-- ./wrapper -->


<!-- DataTables -->
<script th:src="@{/asserts/bower_components/datatables.net/js/jquery.dataTables.min.js}"></script>
<script th:src="@{/asserts/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js}"></script>
<!-- SlimScroll -->
<script th:src="@{/asserts/bower_components/jquery-slimscroll/jquery.slimscroll.min.js}"></script>
<!-- FastClick -->
<script th:src="@{/asserts/bower_components/fastclick/lib/fastclick.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/asserts/dist/js/adminlte.min.js}"></script>
<!-- AdminLTE for demo purposes -->
<script th:src="@{/asserts/dist/js/demo.js}"></script>
<!-- page script -->

<script type="text/javascript">

    $("#uploadFile").submit(function () {
        if ($("#input-b2").val() === "") {
            layer.msg('亲，请选择文件哦!', {
                icon: 0,
                time: 1500
            });
            return false;
        }else {
            return true;
        }
    })

    $(function () {
        $(window).scroll(function () {
            if ($(window).scrollTop() > 150) {
                $('#top').css('display', 'block');    //<div id-'top'></div>假如有这么个div是那个向上图标的div。css默认none
            } else {
                $('#top').css('display', 'none');
            }
        });
    });

</script>
<script>
var idArr = [];
/*记住单个id*/
function recordId(obj) {
    if (idArr.length === 0 || obj.checked === true) {
        idArr.push(obj.value);
    } else {
        for (var index in idArr) {
            if (idArr[index] === obj.value) {
                delete idArr[index];
            }
        }
    }
}
/*记录所有id*/
function checkAllId(obj) {

    var checknames = document.getElementsByName("checks");
    for (var i = 0; i < checknames.length; i++) {
        checknames[i].checked = obj.checked;
        if (obj.checked) {
            idArr.push(checknames[i].value);
        } else {
            idArr.length = 0;
        }
    }
}
function submit() {
    console.log(idArr);
    var flag = true;
    for (var index in idArr) {
        if (idArr[index] != null) {
            flag = false;
        }
    }
    if (idArr.length == 0 || flag) {
        layer.msg('亲，请先选择要删除的项哦!', {
            icon: 0,
            time: 1500
        });
    } else{
        layer.confirm("确认删除？",
            {
                btn: ['确定', '取消'] //按钮
            },
            function () {
                var checks = idArr.toString();
                $.ajax({
                    type: 'POST',
                    url: "[[${#httpServletRequest.getContextPath()}]]"+"/comVisit/visitDelete?checks="+checks,
                    success: function (data) {
                        if (data.id === 0) {
                            layer.msg(data.data, {
                                icon: 1,
                                time: 500
                            });
                            setTimeout(function () {
                                location.replace(location.href);
                            }, 500);
                        } else {
                            layer.msg(data.data, {
                                icon: 0,
                                time: 2000
                            });
                        }
                    },
                    error: function (data) {
                        console.log(data.msg);
                    }
                });
            },
            function () {
                layer.msg('已取消！', {icon: 0});
                return false;
            }
        );
    }

};
function submitDelete(comVisitId) {
    layer.confirm("确认删除？",
        {
            btn: ['确定', '取消'] //按钮
        },
        function () {
            $.ajax({
                type: 'POST',
                url: "[[${#httpServletRequest.getContextPath()}]]"+"/comVisit/visitDelete?checks="+comVisitId,
                success: function (data) {
                    if (data.id === 0) {
                        layer.msg(data.data, {
                            icon: 1,
                            time: 500
                        });
                        setTimeout(function () {
                            location.replace(location.href);
                        }, 500);
                    } else {
                        layer.msg(data.data, {
                            icon: 0,
                            time: 2000
                        });
                    }
                },
                error: function (data) {
                    console.log(data.msg);
                }
            });
        },
        function () {
            layer.msg('已取消！', {icon: 0});
            return false;
        }
    );
};


</script>
<script>

    $(function () {
        $('#example1').DataTable({
                "aaSorting": [
                    [2, "desc"]
                ],//默认第3列降序
                "bStateSave": true, //状态保存
                "aoColumnDefs": [{"bSortable": false, "aTargets": [0, 1, 3, 4, 5, 6, 7, 8]}],
                "paging": false, //关闭页码
                "lengthChange": false,//关闭每页显示多少个选项
                "info": false,//关闭页码底端信息
                "searching": false,//关闭搜索栏
            }
        )
    })

    $("#all").click(function () {
        if (this.checked) {
            $(".checks").prop("checked", true);
            $("#all").prop("value", "全不选");
        } else {
            $(".checks").prop("checked", false);
            $("#all").prop("value", "全选");
        }
    });


    function changePage(searchUrl,coId,pageNow) {
        if (searchUrl != null && searchUrl.trim() != "") {
            window.location.href = '[[${#httpServletRequest.getContextPath()}]]' + searchUrl + '&pageSize=' + $("#pageSize").val();
        } else {
            window.location.href = '[[${#httpServletRequest.getContextPath()}]]/comVisit/visitList?pageSize=' + $("#pageSize").val()+'&coId='+coId+'&pageNow='+pageNow;
        }
    }

    /*查询的非空判定*/
    $("#searchFrom").submit(
        function () {
            var comVisitDate = $("#comVisitDate").val();
            var coName = $("#coName").val();
            var personname = $("#personname").val();
            if ((comVisitDate == null || comVisitDate === "") && (coName == null || coName === "") && (personname == null || personname === "")) {
                layer.msg('亲，查询内容不能为空哦!', {
                    icon: 0,
                    time: 1500
                });
                return false;
            }
            return true;
        }
    );

    /*联想输入*/
    $(function () {
        $("#personname").allhrcAutoComplete({
            url: '[[${#httpServletRequest.getContextPath()}]]/find/hrcJson',
        });
    })

    $(function () {
        $("#coName").companyNameAutoComplete({
            url: '[[${#httpServletRequest.getContextPath()}]]/find/companyNameJson',
        });
    })
</script>

</body>
</html>